import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

public class cmd implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
        Player player = (Player) commandSender;




        try {
            if (player.hasPermission("xzrui.vanish")) {
                for (Player otherPlayer : Bukkit.getOnlinePlayers()) {
                    otherPlayer.hidePlayer(player);
                    player.sendMessage("Gemini | 你已隐身");
                    player.setDisplayName("隐身 " + player.getName());
                }



            }else {
                player.sendMessage("§c权限不足");
            }
        }catch (NullPointerException ignore) {

        }

        return false;


    }
}
